﻿using Demo.Service;
using Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Demo.View
{
    public partial class UserDetail : Form
    {
        private UserService userService;
        public UserDetail()
        {
            InitializeComponent();
            userService = new UserService();
        }

        public void SetUser(int id)
        {
            if(id != -1)
            {
                User user = userService.Get(id);
                this.txtUserId.Text = user.Id.ToString();
                this.txtUserName.Text = user.Name;
                this.txtUserPassword.Text = user.Password;
                this.txtUserStatus.Text = user.status.ToString();
            }
        }
    }
}
